<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>prc: xprc_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">prc
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xprc__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xprc_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains an example using the <a class="el" href="struct_x_prc.html" title="The XPrc instance data structure. ">XPrc</a> driver to test the registers on the device. </p>
<dl class="section note"><dt>Note</dt><dd>None</dd></dl>
<p>MODIFICATION HISTORY: </p><pre>
Ver      Who   Date           Changes
<hr/>

1.0   ms    07/18/2016     First Release</pre><pre></pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:abe6791e387b3717786af2eed5ab74b8a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xprc__example_8c.html#abe6791e387b3717786af2eed5ab74b8a">XPRC_DEVICE_ID</a>&#160;&#160;&#160;XPAR_PRC_0_DEVICE_ID</td></tr>
<tr class="memdesc:abe6791e387b3717786af2eed5ab74b8a"><td class="mdescLeft">&#160;</td><td class="mdescRight">The following constants map to the XPAR parameters created in the xparameters.h file.  <a href="#abe6791e387b3717786af2eed5ab74b8a">More...</a><br /></td></tr>
<tr class="separator:abe6791e387b3717786af2eed5ab74b8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a27ed847b2e946decd90de3370484db51"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xprc__example_8c.html#a27ed847b2e946decd90de3370484db51">XPrc_Example</a> (u16 DeviceId)</td></tr>
<tr class="memdesc:a27ed847b2e946decd90de3370484db51"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function does a minimal test on the PRC device and driver as a design example.  <a href="#a27ed847b2e946decd90de3370484db51">More...</a><br /></td></tr>
<tr class="separator:a27ed847b2e946decd90de3370484db51"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5765ffedbd730a8b289991c23dc0bd2f"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xprc__example_8c.html#a5765ffedbd730a8b289991c23dc0bd2f">Xprc_Check_User_Command</a> (u16 VsmId, XGpio ShiftVsmGpio, XGpio CountVsmGpio)</td></tr>
<tr class="memdesc:a5765ffedbd730a8b289991c23dc0bd2f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to test the User Command.  <a href="#a5765ffedbd730a8b289991c23dc0bd2f">More...</a><br /></td></tr>
<tr class="separator:a5765ffedbd730a8b289991c23dc0bd2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac01e9e9445033fc90819edb82300b676"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xprc__example_8c.html#ac01e9e9445033fc90819edb82300b676">Xprc_Check_RestartWithStatus_Command</a> (u16 VsmId)</td></tr>
<tr class="memdesc:ac01e9e9445033fc90819edb82300b676"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to test the Restart with Status Command.  <a href="#ac01e9e9445033fc90819edb82300b676">More...</a><br /></td></tr>
<tr class="separator:ac01e9e9445033fc90819edb82300b676"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a93102a7b8b4e6107d9f60947b2a0f0"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xprc__example_8c.html#a0a93102a7b8b4e6107d9f60947b2a0f0">Xprc_Check_TriggerRmMapping</a> (u16 VsmId)</td></tr>
<tr class="memdesc:a0a93102a7b8b4e6107d9f60947b2a0f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to test that we can set/get the Trigger to RM mapping registers.  <a href="#a0a93102a7b8b4e6107d9f60947b2a0f0">More...</a><br /></td></tr>
<tr class="separator:a0a93102a7b8b4e6107d9f60947b2a0f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4282a7ea0bf561014a459c842b6bab1c"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xprc__example_8c.html#a4282a7ea0bf561014a459c842b6bab1c">Xprc_Check_BsIndex_Reg</a> (u16 VsmId)</td></tr>
<tr class="memdesc:a4282a7ea0bf561014a459c842b6bab1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to test that we can set/get the BS Index registers.  <a href="#a4282a7ea0bf561014a459c842b6bab1c">More...</a><br /></td></tr>
<tr class="separator:a4282a7ea0bf561014a459c842b6bab1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a718f120d4e23687969480731b08d930f"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xprc__example_8c.html#a718f120d4e23687969480731b08d930f">Xprc_Check_RmControl_Reg</a> (u16 VsmId)</td></tr>
<tr class="memdesc:a718f120d4e23687969480731b08d930f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to test that we can set/get the RM Control registers.  <a href="#a718f120d4e23687969480731b08d930f">More...</a><br /></td></tr>
<tr class="separator:a718f120d4e23687969480731b08d930f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9042c47a9658be469a2b5e35bd51f58"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xprc__example_8c.html#ac9042c47a9658be469a2b5e35bd51f58">Xprc_Check_BsSize_Reg</a> (u16 VsmId)</td></tr>
<tr class="memdesc:ac9042c47a9658be469a2b5e35bd51f58"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to test that we can set/get the BS Size registers.  <a href="#ac9042c47a9658be469a2b5e35bd51f58">More...</a><br /></td></tr>
<tr class="separator:ac9042c47a9658be469a2b5e35bd51f58"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afe71c72fb6ccf57cd06c53af3d960d45"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xprc__example_8c.html#afe71c72fb6ccf57cd06c53af3d960d45">Xprc_Check_BsAddress_Reg</a> (u16 VsmId)</td></tr>
<tr class="memdesc:afe71c72fb6ccf57cd06c53af3d960d45"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to test that we can set/get the BS Address registers.  <a href="#afe71c72fb6ccf57cd06c53af3d960d45">More...</a><br /></td></tr>
<tr class="separator:afe71c72fb6ccf57cd06c53af3d960d45"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa00693461ce8502ac36969f4fd296448"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xprc__example_8c.html#aa00693461ce8502ac36969f4fd296448">Xprc_Program_PRC</a> (u16 VsmId)</td></tr>
<tr class="memdesc:aa00693461ce8502ac36969f4fd296448"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to Program the PRC.  <a href="#aa00693461ce8502ac36969f4fd296448">More...</a><br /></td></tr>
<tr class="separator:aa00693461ce8502ac36969f4fd296448"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab434664ae13e0888bd9c6f946a935297"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xprc__example_8c.html#ab434664ae13e0888bd9c6f946a935297">Xprc_Restart_VSMs</a> (u16 VsmId)</td></tr>
<tr class="memdesc:ab434664ae13e0888bd9c6f946a935297"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is used to Restart the VSMs.  <a href="#ab434664ae13e0888bd9c6f946a935297">More...</a><br /></td></tr>
<tr class="separator:ab434664ae13e0888bd9c6f946a935297"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xprc__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the main function to call the example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br /></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="abe6791e387b3717786af2eed5ab74b8a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abe6791e387b3717786af2eed5ab74b8a">&#9670;&nbsp;</a></span>XPRC_DEVICE_ID</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XPRC_DEVICE_ID&#160;&#160;&#160;XPAR_PRC_0_DEVICE_ID</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The following constants map to the XPAR parameters created in the xparameters.h file. </p>
<p>They are defined here such that a user can easily change all the needed parameters in one place. </p>

<p class="reference">Referenced by <a class="el" href="xprc__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a840291bc02cba5474a4cb46a9b9566fe">&#9670;&nbsp;</a></span>main()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is the main function to call the example. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful.</li>
<li>XST_FAILURE if failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xprc__example_8c.html#abe6791e387b3717786af2eed5ab74b8a">XPRC_DEVICE_ID</a>, and <a class="el" href="xprc__example_8c.html#a27ed847b2e946decd90de3370484db51">XPrc_Example()</a>.</p>

</div>
</div>
<a id="afe71c72fb6ccf57cd06c53af3d960d45"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afe71c72fb6ccf57cd06c53af3d960d45">&#9670;&nbsp;</a></span>Xprc_Check_BsAddress_Reg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 Xprc_Check_BsAddress_Reg </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>VsmId</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to test that we can set/get the BS Address registers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">VsmId</td><td>is the identifier of the VSM to access.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful.</li>
<li>XST_FAILURE if failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>
<p>&lt; A loop variable used to iterate round RMs in the PRC</p>
<p>Start by setting all of the BS Address registers in all VSms to zero</p>
<p>Now check each BsAddress can be updated without changing any other BsAddress register</p>

<p class="reference">References <a class="el" href="group__prc__v1__0.html#ga74079c4b27f1c4dc1a7947911b7682d1">XPrc_GetBsAddress()</a>, <a class="el" href="group__prc__v1__0.html#gaf28b7a33ca4cf58e128c968df5e54ecf">XPrc_GetNumberOfVsms</a>, <a class="el" href="group__prc__v1__0.html#ga4775c570e83214c75ca9203731b42da0">XPrc_GetNumRmsAllocated</a>, and <a class="el" href="group__prc__v1__0.html#ga66ef8c25b6a68047e74a6d30d215ebf9">XPrc_SetBsAddress()</a>.</p>

</div>
</div>
<a id="a4282a7ea0bf561014a459c842b6bab1c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4282a7ea0bf561014a459c842b6bab1c">&#9670;&nbsp;</a></span>Xprc_Check_BsIndex_Reg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 Xprc_Check_BsIndex_Reg </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>VsmId</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to test that we can set/get the BS Index registers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">VsmId</td><td>is the identifier of the VSM to access.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful.</li>
<li>XST_FAILURE if failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>
<p>&lt; A loop variable used to iterate round RMs in the PRC</p>
<p>The maximum value for a BsIndex register is the number of RMs allocated -1. We can't use any number greater than that or else it will alias.</p>
<p>Start by setting all of the BS Index registers in all VSms to zero</p>
<p>Now check each BsIndex can be updated without changing any other BsIndex register</p>

<p class="reference">References <a class="el" href="group__prc__v1__0.html#gaf28b7a33ca4cf58e128c968df5e54ecf">XPrc_GetNumberOfVsms</a>, <a class="el" href="group__prc__v1__0.html#ga4775c570e83214c75ca9203731b42da0">XPrc_GetNumRmsAllocated</a>, <a class="el" href="group__prc__v1__0.html#ga4328f5b970ea41269486688d36c71330">XPrc_GetRmBsIndex()</a>, and <a class="el" href="group__prc__v1__0.html#gafa73a0de6152ced50f55b50533135d0d">XPrc_SetRmBsIndex()</a>.</p>

</div>
</div>
<a id="ac9042c47a9658be469a2b5e35bd51f58"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac9042c47a9658be469a2b5e35bd51f58">&#9670;&nbsp;</a></span>Xprc_Check_BsSize_Reg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 Xprc_Check_BsSize_Reg </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>VsmId</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to test that we can set/get the BS Size registers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">VsmId</td><td>is the identifier of the VSM to access.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful.</li>
<li>XST_FAILURE if failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>
<p>&lt; A loop variable used to iterate round RMs in the PRC</p>
<p>Now check each BsSize can be updated without changing any other BsSize register</p>

<p class="reference">References <a class="el" href="group__prc__v1__0.html#ga23ab1e4290b46abb79a99627c2f85d41">XPrc_GetBsSize()</a>, <a class="el" href="group__prc__v1__0.html#gaf28b7a33ca4cf58e128c968df5e54ecf">XPrc_GetNumberOfVsms</a>, <a class="el" href="group__prc__v1__0.html#ga4775c570e83214c75ca9203731b42da0">XPrc_GetNumRmsAllocated</a>, and <a class="el" href="group__prc__v1__0.html#ga77ae77f041ca0822956e93f2c4841384">XPrc_SetBsSize()</a>.</p>

</div>
</div>
<a id="ac01e9e9445033fc90819edb82300b676"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac01e9e9445033fc90819edb82300b676">&#9670;&nbsp;</a></span>Xprc_Check_RestartWithStatus_Command()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 Xprc_Check_RestartWithStatus_Command </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>VsmId</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to test the Restart with Status Command. </p>
<p>Flip the VSM state and set a new RM. Check the status is as expected. Flip the VSM state back to what it was and set the original RM. Check the status is as expected</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">VsmId</td><td>is the identifier of the VSM to access.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful.</li>
<li>XST_FAILURE if failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>
<p>Make sure the VSM is active so I can read the empty/full state</p>
<p>Get the currently loaded RM and make sure it's the same as it was when the VSM was active. Shutting it down shouldn't have changed that.</p>

<p class="reference">References <a class="el" href="group__prc__v1__0.html#gaf221d2761b3cb2f71b51c4029711e83e">XPRC_CR_VS_EMPTY</a>, <a class="el" href="group__prc__v1__0.html#gada47152f33eac349c3fc17734b31ded8">XPRC_CR_VS_FULL</a>, <a class="el" href="group__prc__v1__0.html#gaf28b7a33ca4cf58e128c968df5e54ecf">XPrc_GetNumberOfVsms</a>, <a class="el" href="group__prc__v1__0.html#ga9d39e24052e6887d4e0e7ed776d9cd67">XPrc_GetNumRms</a>, <a class="el" href="group__prc__v1__0.html#ga90981b900ba7f2e8db1eae4f5d1a8eae">XPrc_GetRmIdFromStatus()</a>, <a class="el" href="group__prc__v1__0.html#ga16cd7447ee658a590b4e84fbcdd655fd">XPrc_GetVsmState()</a>, <a class="el" href="group__prc__v1__0.html#ga169cd249e2ebac1ec7aaa31c6be22ec0">XPrc_IsVsmInShutdown()</a>, <a class="el" href="group__prc__v1__0.html#ga1352d5c7fa50ff03c099da95d1f6d368">XPrc_ReadStatusReg()</a>, <a class="el" href="group__prc__v1__0.html#gabf496a0a03c16a90c4579f5eb9346289">XPrc_SendRestartWithNoStatusCommand()</a>, <a class="el" href="group__prc__v1__0.html#gaf1aadeb2cbc8b0ea416b86f6a722112d">XPrc_SendRestartWithStatusCommand()</a>, <a class="el" href="group__prc__v1__0.html#ga8ae7427d46695146ebd8bb1cae333ad7">XPrc_SendShutdownCommand()</a>, <a class="el" href="group__prc__v1__0.html#ga210d1f8df780c04c34d97f12c5248c16">XPRC_SR_STATE_EMPTY</a>, and <a class="el" href="group__prc__v1__0.html#ga8c5e23d32e70feaa633f2947fc072c16">XPRC_SR_STATE_FULL</a>.</p>

</div>
</div>
<a id="a718f120d4e23687969480731b08d930f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a718f120d4e23687969480731b08d930f">&#9670;&nbsp;</a></span>Xprc_Check_RmControl_Reg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 Xprc_Check_RmControl_Reg </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>VsmId</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to test that we can set/get the RM Control registers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">VsmId</td><td>is the identifier of the VSM to access.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful.</li>
<li>XST_FAILURE if failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>The RM Control register contains the following fields: Name | Min value | Max value | Shutdown Required | 0 | 3 | Startup Required | 0 | 1 | Reset Required | 0 | 3 | Reset Duration | 0 | 255 | </dd></dl>
<p>&lt; A loop variable used to iterate round RMs in the PRC</p>
<p>Start by setting all of the Rm Control registers in all VSms to zero</p>
<p>Now check each RM Control register can be updated without changing any other RM Control register</p>

<p class="reference">References <a class="el" href="group__prc__v1__0.html#gaf28b7a33ca4cf58e128c968df5e54ecf">XPrc_GetNumberOfVsms</a>, <a class="el" href="group__prc__v1__0.html#ga4775c570e83214c75ca9203731b42da0">XPrc_GetNumRmsAllocated</a>, <a class="el" href="group__prc__v1__0.html#ga4ae04635e1799c1fff8a1bf0acd7f10e">XPrc_GetRmControl()</a>, and <a class="el" href="group__prc__v1__0.html#gaa3c36e7ac22439e68a49baf08a07cfc8">XPrc_SetRmControl()</a>.</p>

</div>
</div>
<a id="a0a93102a7b8b4e6107d9f60947b2a0f0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0a93102a7b8b4e6107d9f60947b2a0f0">&#9670;&nbsp;</a></span>Xprc_Check_TriggerRmMapping()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 Xprc_Check_TriggerRmMapping </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>VsmId</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to test that we can set/get the Trigger to RM mapping registers. </p>
<p>For each trigger allocated, set the value of the RM it will load.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">VsmId</td><td>is the identifier of the VSM to access.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful.</li>
<li>XST_FAILURE if failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>The width of this register is set by the number of allocated RMs, so we can't use any number greater than that or else it will alias. </dd></dl>
<p>&lt; A loop variable used to iterate round triggers in the PRC</p>
<p>&lt; A loop variable used to iterate round RMs in the PRC</p>
<p>&lt; A loop variable used to iterate round VSMs in the PRC</p>
<p>&lt; A loop variable used to iterate round triggers in the PRC</p>
<p>Now check each trigger register can be updated without changing any other trigger register</p>

<p class="reference">References <a class="el" href="group__prc__v1__0.html#gaf28b7a33ca4cf58e128c968df5e54ecf">XPrc_GetNumberOfVsms</a>, <a class="el" href="group__prc__v1__0.html#ga4775c570e83214c75ca9203731b42da0">XPrc_GetNumRmsAllocated</a>, <a class="el" href="group__prc__v1__0.html#gad21071ccece439ee68cb2874f99983d8">XPrc_GetNumTriggersAllocated</a>, <a class="el" href="group__prc__v1__0.html#ga715f096ec7bc1c5eaac8395444fcd03f">XPrc_GetTriggerToRmMapping()</a>, and <a class="el" href="group__prc__v1__0.html#gabc3b273ffd5f67fbdfc7f57d7929b45b">XPrc_SetTriggerToRmMapping()</a>.</p>

</div>
</div>
<a id="a5765ffedbd730a8b289991c23dc0bd2f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5765ffedbd730a8b289991c23dc0bd2f">&#9670;&nbsp;</a></span>Xprc_Check_User_Command()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 Xprc_Check_User_Command </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>VsmId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XGpio&#160;</td>
          <td class="paramname"><em>ShiftVsmGpio</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XGpio&#160;</td>
          <td class="paramname"><em>CountVsmGpio</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to test the User Command. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">VsmId</td><td>is the identifier of the VSM to access. </td></tr>
    <tr><td class="paramname">ShiftVsmGpio</td><td>is Instance of the GPIO attached to the PRC's Shift VSM. </td></tr>
    <tr><td class="paramname">CountVsmGpio</td><td>is Instance of the GPIO attached to the PRC's Count VSM.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful.</li>
<li>XST_FAILURE if failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This is only valid for this particular configuration of the PRC so it cannot be used in a general PRC test case. This is configuration dependent because each VSM has its own GPIO. </dd></dl>
<p>&lt; A pointer to a GPIO</p>
<p>Work out which VSM this is and select the correct GPIO instance to use</p>
<p>What signals will be enabled? RM_SHUTOWN, RM_DECOUPLE and RM_RESET are alwas enabled SW_SHUTDOWN and SW_STARTUP are only enabled if there's some kind of control interface. Of course, there will be or else we'd never be able to test it in this program :-)</p>

<p class="reference">References <a class="el" href="group__prc__v1__0.html#gae563b82b291ba26d8b6c5baaa8144b73">XPRC_CR_USER_CONTROL_RM_DECOUPLE_BIT</a>, <a class="el" href="group__prc__v1__0.html#ga6e35414473fc5e26c96db54d6dc44bae">XPRC_CR_USER_CONTROL_RM_RESET_BIT</a>, <a class="el" href="group__prc__v1__0.html#ga3ed8dfec1197fb072d20d942de4aa90f">XPRC_CR_USER_CONTROL_RM_SHUTDOWN_REQ_BIT</a>, <a class="el" href="group__prc__v1__0.html#ga9f5efab7321c347477127e3179f509cf">XPRC_CR_USER_CONTROL_SW_SHUTDOWN_REQ_BIT</a>, <a class="el" href="group__prc__v1__0.html#ga46d6b311b4ead348bb4b28de8c6836d2">XPRC_CR_USER_CONTROL_SW_STARTUP_REQ_BIT</a>, <a class="el" href="group__prc__v1__0.html#gaf28b7a33ca4cf58e128c968df5e54ecf">XPrc_GetNumberOfVsms</a>, and <a class="el" href="group__prc__v1__0.html#gad837665803c2971d369e832f4d4bd764">XPrc_SendUserControlCommand()</a>.</p>

</div>
</div>
<a id="a27ed847b2e946decd90de3370484db51"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a27ed847b2e946decd90de3370484db51">&#9670;&nbsp;</a></span>XPrc_Example()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XPrc_Example </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>DeviceId</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function does a minimal test on the PRC device and driver as a design example. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">DeviceId</td><td>is the XPAR_&lt;prc_instance&gt;_DEVICE_ID value from xparameters.h.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful</li>
<li>XST_FAILURE if failed</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>
<p>&lt; Instance of the GPIO that's connected to the USR_ACCESS primitive</p>
<p>&lt; Instance of the GPIO attached to the PRC's Shift VSM's outputs</p>
<p>&lt; Instance of the GPIO attached to the PRC's Count VSM's outputs</p>
<p>&lt; A loop variable used to iterate round VSMs in the PRC</p>
<p>&lt; A loop variable used to iterate round RMs in the PRC</p>
<p>Initialize the PRC driver so that it's ready to use. Look up the configuration in the config table, then initialize it.</p>
<p>Perform a self-test to ensure that the hardware was built correctly</p>
<p>Print the PRC's status when the program starts This should only print anything if debug is turned on</p>
<p>We can only reprogram VSMs when they are in shutdown, so shutdown any active VSMs</p>
<p>The ICAP has lower priority than JTAG and SDK and Vivado HW Debugger both use JTAG to control the device and get status. This can occasionally mean that the first partial bitstream load will fail if the SDK program is reloaded without reconfiguring the entire device.</p>
<p>This code attempts to detect that case and flush it before we enter the actual test phase.</p>
<p>NOTE: If you press F11 in SDK to reload the program this can cause error messages to appear. These can be ignored.</p>
<p>Send triggers and check that each one loaded the correct bitstream</p>
<p>Send a software trigger to the PRC to get it to load the partial bitstream for VsmID, RmId.</p>
<p>Use the value twice. This ensures that both the RmId and State fields come from the same read. If only one field is required, pass &amp;Prc instead of NULL, and VsmId instead of Status to these functions and they will read the register rather than parse the pre-read data</p>

<p class="reference">References <a class="el" href="group__prc__v1__0.html#ga860a4c5ba01881e1547b8150affa7c0d">XPrc_CfgInitialize()</a>, <a class="el" href="group__prc__v1__0.html#ga61ee29cca9dae9f18fb9a635f5c0a4b2">XPrc_LookupConfig()</a>, and <a class="el" href="group__prc__v1__0.html#gaf15c985cf911548b53252824dc933313">XPrc_SelfTest()</a>.</p>

<p class="reference">Referenced by <a class="el" href="xprc__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a id="aa00693461ce8502ac36969f4fd296448"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa00693461ce8502ac36969f4fd296448">&#9670;&nbsp;</a></span>Xprc_Program_PRC()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 Xprc_Program_PRC </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>VsmId</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to Program the PRC. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">VsmId</td><td>is the identifier of the VSM to access.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful.</li>
<li>XST_FAILURE if failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>For each allocated RM in each VSM, generate a partial bitstream and store it in memory. Program the PRC to point at it. </dd></dl>
<p>&lt; A loop variable used to iterate round RMs in the PRC</p>
<p>A bitstream looks like this ffff ffff : Dummy word 0000 00bb : Bus Width Sync Word 1122 0044 : Bus Width Detect ffff ffff : Dummy word ffff ffff : Dummy word aa99 5566 : Sync Word 2000 0000 : NOOP 3001 a001 : Write 1 word to user access &lt; id &gt; : 2000 0000 : NOOP 3000 8001 : Desync command 0000 000d : Desync command 2000 0000 : NOOP</p>
<p>This is a 7 series project so BsIndex is always the RmId. It will have been set correctly when the core was configured, but we'll set it here because we distrubed it above in the register test</p>

<p class="reference">References <a class="el" href="group__prc__v1__0.html#gaf28b7a33ca4cf58e128c968df5e54ecf">XPrc_GetNumberOfVsms</a>, <a class="el" href="group__prc__v1__0.html#ga9d39e24052e6887d4e0e7ed776d9cd67">XPrc_GetNumRms</a>, <a class="el" href="group__prc__v1__0.html#ga66ef8c25b6a68047e74a6d30d215ebf9">XPrc_SetBsAddress()</a>, <a class="el" href="group__prc__v1__0.html#ga77ae77f041ca0822956e93f2c4841384">XPrc_SetBsSize()</a>, <a class="el" href="group__prc__v1__0.html#gafa73a0de6152ced50f55b50533135d0d">XPrc_SetRmBsIndex()</a>, and <a class="el" href="group__prc__v1__0.html#gaa3c36e7ac22439e68a49baf08a07cfc8">XPrc_SetRmControl()</a>.</p>

</div>
</div>
<a id="ab434664ae13e0888bd9c6f946a935297"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab434664ae13e0888bd9c6f946a935297">&#9670;&nbsp;</a></span>Xprc_Restart_VSMs()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xprc_Restart_VSMs </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>VsmId</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is used to Restart the VSMs. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">VsmId</td><td>is the identifier of the VSM to access.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful.</li>
<li>XST_FAILURE if failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="group__prc__v1__0.html#gaf28b7a33ca4cf58e128c968df5e54ecf">XPrc_GetNumberOfVsms</a>, <a class="el" href="group__prc__v1__0.html#ga169cd249e2ebac1ec7aaa31c6be22ec0">XPrc_IsVsmInShutdown()</a>, and <a class="el" href="group__prc__v1__0.html#gabf496a0a03c16a90c4579f5eb9346289">XPrc_SendRestartWithNoStatusCommand()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
